<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>生产者大数据发布</title>
		<link rel="stylesheet" href="__CSS__/mui.min.css" />
		<link rel="stylesheet" href="__CSS__/iconfont.css" />
		<link rel="stylesheet" href="__CSS__/style.css" />
		<link rel="stylesheet" href="__CSS__/mall.css" />
		<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.3&key=ebc4693ac7f608307dc039bd33c39675"></script>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav public-color">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" onclick='window.location.href="{:url('member/index')}"'></a>
			<h1 class="mui-title">生产者大数据发布</h1>
		</header>
		<div class="mui-content ">
			<div class="gerenzl_nr">
				<form id="myForm" class="mui-input-group gerenzl_group">
					<div class="mui-input-row ">
						<label><em>*</em>生产者名</label>
						<input type="text" name="name" value="{$model.name|default=''}" class="mui-input-group" placeholder="请填写生产者名">
					</div>
					<div class="mui-input-row ">
						<label><em>*</em>图片</label>
						<div class="actions" style="float: right;">
							<div class="file-btn" style="border: 1px solid #CCCCCC;">
								<input type="hidden" id="thumb" name="thumb" value="{$model.thumb|default=''}">
								<input onchange="UpladFile('product', 500)" type="file" accept="image/*" id="file" name="file" multiple>
								<span><img class='img_list' src="{$model.thumb|default='__IMG__/logo1.png'}" id='thumb_img' style="width: 100%;height: 100%;border-radius: 100%" ></span>
							</div>
						</div>
					</div>
					<div class="mui-input-row">
						<label><em>*</em>生产者类别</label>
						<select class="mui-btn mui-btn-block" name="type">
							<option value="1" {if $model.type==1}selected{/if}>合作社</option>
							<option value="2" {if $model.type==2}selected{/if}>家庭农场</option>
							<option value="3" {if $model.type==3}selected{/if}>龙头企业</option>
						</select>
					</div>
					<div class="hy_line"></div>
					<div class="mui-input-row ">
						<label><em>*</em>联系人</label>
						<input type="text" name="contact" value="{$model.contact|default=''}" class="mui-input-group" placeholder="请填写联系人">
					</div>
					<div class="mui-input-row ">
						<label><em>*</em>联系电话</label>
						<input type="text" name="phone" value="{$model.phone|default=''}" class="mui-input-group" placeholder="请填写联系电话">
					</div>
					<div class="mui-input-row">
						<label><em>*</em>地区</label>
						<input type="text" readonly="" placeholder="请选择地区" id="myAddrs" data-key="{$model.area|default=''}" value="">
						<input type="hidden" id="area" name="area" value="{$model.area|default=''}" />
					</div>
					<div class="mui-input-row">
						<label><em>*</em>详细地址</label>
						<input type="text" name="address" value="{$model.address|default=''}" class="mui-input-group" placeholder="请填写详细地址 ">
					</div>
					<div class="mui-input-row ">
						<label><em>*</em>员工人数</label>
						<input type="text" name="people" value="{$model.people|default=''}" class="mui-input-group" placeholder="请填写员工人数">
					</div>
					<div class="mui-input-row ">
						<label><em>*</em>主营范围</label>
						<input type="text" name="main_sell" value="{$model.main_sell|default=''}" class="mui-input-group" placeholder="请填写主营范围">
					</div>
					<input class="lng" id="lng" name="lng" value="" hidden="hidden"/>
					<input class="lat" id="lat" name="lat" value="" hidden="hidden"/>
					<button type="submit" class="fjysq_sbtn">保存</button>
				</form>
			</div>
		</div>
	</body>

</html>
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/jquery.validate.min.js"></script>
<script src="__JS__/mui.min.js"></script>
<script src="__LIB__/layer.js"></script>
<script src="__JS__/image.zip.js"></script>
<script src="__JS__/index.js"></script>
<link href="__JS__/scs.min.css" rel="stylesheet">
<script src="__JS__/jquery.scs.min.js"></script>
<script src="__JS__/district.js"></script>
<script type="text/javascript">
	app.getmap();
	$(function() {
		$("#myForm").validate({
			focusInvalid: true,
			onkeyup: false,
			ignore: "",
			onfocusout: false,
			showErrors: function(errorMap, errorList) {
				var msg = "";
				if(errorList != null && errorList != "") {
					msg = errorList[0]['message'];
					layer.msg(msg);
				}
			},
			submitHandler: function(form) { //表单提交句柄,为一回调函数，带一个参数：form   
				// ajax提交
				app.ajax();
			},
			rules: {
				name: {
					required: true
				},
				thumb: {
					required: true
				},
				contact: {
					required: true
				},
				phone: {
					required: true
				},
				area: {
					required: true
				},
				address: {
					required: true
				},
				people: {
					required: true
				},
				main_sell: {
					required: true
				}
			},
			messages: {
				name: {
					required: "请填写生产者名 "
				},
				thumb: {
					required: "请上传照片"
				},
				contact: {
					required: "请填写联系人 "
				},
				phone: {
					required: "请填写联系电话 "
				},
				area: {
					required: "请选择地区"
				},
				address: {
					required: "请填写地址 "
				},
				people: {
					required: "请填写员工人数"
				},
				main_sell: {
					required: "请填写主营范围"
				}
			}
		});
	});
</script>